<?php

namespace App\CustHub\Controller;

use App\Common\Service\RegionService;

use App\CustHub\Annotation\VerifySignature;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\PostMapping;
use Psr\Http\Message\ResponseInterface;

#[Controller(prefix: 'ch/region'),VerifySignature]
class RegionController extends BaseController
{
    #[Inject]
    protected RegionService $service;

    #[PostMapping('getFirstRegionList')]
    public function getFirstRegionList(): ResponseInterface
    {
        return $this->success('地区一级列表', $this->service->getFirstRegionList());
    }

    #[PostMapping('getSecondaryTreeList')]
    public function getSecondaryTreeList(): ResponseInterface
    {
        return $this->success('地区二级树形结构', $this->service->getSecondaryTreeList());
    }
}